<template>
  <div class="box">
    <p class="top"><img src="./../../assets/addressadministration_icon_check_selected.png@2x.png" alt=""></p>
    <p class="success">兑换成功</p>
    <p class="danfa">点击&nbsp;<span class="dan" @click="gomyorder">我的券</span>&nbsp;即可即时查询订单详情</p>
    <div class="imglist">
        <img :src="imgurl" alt="">
        <div class="right">
            <p>{{productName}}</p>
            <p v-if="Integral">{{Integral}}积分</p>
        </div>
    </div>
    <!-- <div class="bottom">
        <p v-if="relist.integral">兑换价格: &nbsp;{{relist.integral}} &nbsp;积分</p>
        <p>券码:0000000</p>
    </div> -->
     <div class="buttonbox fixed" ref="buttonbox" @click="gohome">
        回到首页
      </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      route:{},
      Integral:"",
      relist:{},
      productName:"",
      imgurl:""
    };
  },
  computed:{
    imgUrl(){
      return this.$store._modules.root._children.a.state
    }
  },
   created() {
    // $router 直接监听无效，尚未查明，故作深拷贝处理
    this.route = Object.assign({}, this.$route);
    //此处应该发送请求
    this.Integral =this.route.query.Integral;
    this.productName =this.route.query.productName;
    this.imgurl =this.route.query.imgurl;
  },
  methods:{
    gohome(){
       this.$router.push({
          path:"/"
        })
    },
    gomyorder(){
      this.$router.push({
          path:"/Myvouchers"
        })
    }
  },
   watch: {
    route() {
      if (this.route.path == "/IntergralResults") {

      }
    }
  }
}
</script>
<style lang="less" scoped>
  .box{
     position: fixed;
     width: 100%;
     height: 100%;
     top: 40px;
     background-color:#f1f2f3;
     .top{
       margin-top: 30px;
     }
     .success{
        font-size:21px;
        color: #ED6E36;
        font-weight: 600;
     }
     .danfa{
          margin: 15px 0 30px 0px;
     }
     .dan{
        color: #ED6E36;
        text-decoration: underline;
     }
     .top img{
        margin: 15px 0 15px 0px;
        width: 20%;
      }
      .imglist{
        margin-left: 5%;
        width: 90%;
        height: 6rem;
        border-radius: 7px;
        background-color: #fff;
        img{
          width: 27%;
          height: 6rem;
          float: left;
          border-radius: 7px;
        }
        .right{
          width: 73%;
          height: 6rem;
          float: left;
        }
        .right p:nth-child(1){
          font-size: 19px;
        }
        .right p{
          font-size: 14px;
          height: 3rem;
          line-height: 3rem;
          padding-left: 10px;
          text-align: left;

        }

      }
      .bottom{
        margin-top: 15px;
        margin-left: 5%;
        width: 90%;
        height: 6rem;
        border-radius: 7px;
        background-color: #fff;
      }
      .bottom p{
        padding-left: 10px;
        height: 3rem;
        line-height: 3rem;
        text-align: left;
      }
   .buttonbox{
    margin-top: 20px;
    margin-left: 4.5%;
    width: 91%;
    color:#fff;
    height: 40px;
    background-color:#ED6E36;
    line-height: 40px;
    border-radius: 5px;
    text-align: center;
    }
  .bgcolor{
    background-color: #E5E5E5;
  }
  .fixed{
    position: fixed;
    bottom: 30px;
    left: 0px;
  }
  }

</style>


